<% layout('/layouts/default.html', {title: '积分发放管理', libs: ['validate']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header with-border">
			<div class="box-title">
				<i class="fa icon-note"></i>积分发放管理
			</div>
			<div class="box-tools pull-right">
				<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
			</div>
		</div>
		<#form:form id="inputForm" model="${kjMemberJob}" action="${ctx}/kj/kjMemberJob/sendIntegral" method="post" class="form-horizontal">
			<div class="box-body">
				<div class="form-unit">${text('基本信息')}</div>
				<#form:hidden path="id"/>
				<#form:hidden name="action" id="action"/>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('用户名')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="kjMember.name"  disabled="disabled" maxlength="255" class="form-control"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('活动名')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="activityName" disabled="disabled" maxlength="255" class="form-control"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('岗位名')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="jobName" disabled="disabled" maxlength="255" class="form-control"/>
							</div>
						</div>
					</div>

					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('预计发放积分')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="integrals" type='number' maxlength="10" class="form-control" min="0"/>
							</div>
						</div>
					</div>

					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('预计服务时长')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="serviceTime" type='number' min="0" maxlength="10" class="form-control"/>
							</div>
						</div>
					</div>
				</div>

				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> ${text('备注(拒绝不通过理由)')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:textarea path="remarks" rows="4" maxlength="500" class="form-control"/>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="box-footer">
				<div class="row">
					<div class="col-sm-offset-2 col-sm-10">
						<% if (hasPermi('kj:kjActivityIntegral:send') && kjMemberJob.sendStatus != '1'){ %>
							<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('发 放')}</button>&nbsp;
							<button type="submit" class="btn btn-sm btn-danger" id="btnReject"><i class="fa fa-check"></i> ${text('拒 绝')}</button>&nbsp;
						<% } %>
						<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
					</div>
				</div>
			</div>
		</#form:form>
	</div>
</div>
<% } %>
<script>
	$('#btnSubmit').click(function(){
		$('#action').val('submit');
	})
	$('#btnReject').click(function(){
		$('#action').val('reject');
	})
$("#inputForm").validate({
	submitHandler: function(form){
		js.ajaxSubmitForm($(form), function(data){
			js.showMessage(data.message);
			if(data.result == Global.TRUE){
				js.closeCurrentTabPage(function(contentWindow){
					contentWindow.page();
				});
			}
		}, "json");
    }
});
</script>
